<?php

use yii\grid\GridView;
use common\helpers\Html;
use common\helpers\Url;
use common\helpers\ImageHelper;
use common\models\bonus\Bonus;
use common\enums\BonusEnum;


$this->title = '奖金详情';
$this->params['breadcrumbs'][] = ['label' => '汇总', 'url' => ['baobiao']];
$this->params['breadcrumbs'][] = ['label' => $title, 'url' => $url];
$this->params['breadcrumbs'][] = ['label' => $this->title];

?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
             <div class="box-header">
                <h3 class="box-title"><?= $this->title; ?></h3>
                <div class="box-tools">

                </div>
            </div>
            <div class="box-body table-responsive">
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    // 'filterModel' => $searchModel,
                    //重新定义分页样式
                    'tableOptions' => ['class' => 'table table-hover rf-table'],
                    'columns' => [
                        [
                            'class' => 'yii\grid\SerialColumn',
                            'visible' => false, // 不显示#
                        ],
                       
                        [
                            'attribute' => 'member.username',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'bonus_type',
                            // 'filter' => Bonus::$typeArr, //不显示搜索框
                            'filter' => false, //不显示搜索框
                            'value' =>function($model){
                                return Bonus::$typeArr[$model->bonus_type];
                            }
                        ],
                        [
                            'attribute' => 'bonus_amount',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'tax',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'fee',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'bonus_real',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'payment_at',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'calc_at',
                            'filter' => false, //不显示搜索框
                            'format' => ['date', 'php:Y-m-d H:i:s'],
                        ],
                        [
                            'attribute' => 'status',
                            'value' => function($model){
                                return BonusEnum::getName($model->status);
                            },
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'header' => '详情列表',
                            'value'=>function($model){
                                return Html::linkButton(['bonus-list','id'=>$model->bonus_id,'type'=>$model->bonus_type,'member_id'=>$model->member_id], '查看列表');
                            },
                            'format' => 'raw'
                        ],
                    ],
                ]); ?>
            </div>
        </div>
    </div>